home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| WANG Integrated Word Processor (document/wangIWP)
| ext
| Unsupported |
1%
| dexvert
| Dynamic Publisher Document (document/dynamicPublisherDocument)
| ext
| Unsupported |
1%
| dexvert
| Excellence! Document (document/excellenceDocument)
| ext
| Unsupported |
1%
| dexvert
| Norton Textra Writer (document/textraWriter)
| ext
| Unsupported |
1%
| dexvert
| IBM DisplayWrite Document (document/ibmDisplayWriteDocument)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| Mailbox text, 1st line "From myrias!mj Thu Oct 20 15:44:19 EDT 1988"
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| application/mbox
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 6d 79 72 | 69 61 73 21 6d 6a 20 54 |From myr|ias!mj T|
|00000010| 68 75 20 4f 63 74 20 32 | 30 20 31 35 3a 34 34 3a |hu Oct 2|0 15:44:|
|00000020| 31 39 20 45 44 54 20 31 | 39 38 38 0a 58 2d 52 4e |19 EDT 1|988.X-RN|
|00000030| 2d 41 72 74 69 63 6c 65 | 3a 20 31 32 31 32 35 20 |-Article|: 12125 |
|00000040| 6f 66 20 63 6f 6d 70 2e | 73 79 73 2e 61 74 61 72 |of comp.|sys.atar|
|00000050| 69 2e 73 74 0a 3e 46 72 | 6f 6d 3a 20 6d 6a 40 6d |i.st.>Fr|om: mj@m|
|00000060| 79 72 69 61 73 2e 55 55 | 43 50 20 28 4d 69 63 68 |yrias.UU|CP (Mich|
|00000070| 61 6c 20 4a 61 65 67 65 | 72 6d 61 6e 6e 29 0a 4e |al Jaege|rmann).N|
|00000080| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000090| 73 79 73 2e 61 74 61 72 | 69 2e 73 74 0a 53 75 62 |sys.atar|i.st.Sub|
|000000a0| 6a 65 63 74 3a 20 43 61 | 6c 6c 69 6e 67 20 63 61 |ject: Ca|lling ca|
|000000b0| 6c 6c 67 75 6c 61 6d 20 | 2d 20 65 78 70 6c 61 6e |llgulam |- explan|
|000000c0| 61 74 69 6f 6e 20 61 6e | 64 20 65 78 61 6d 70 6c |ation an|d exampl|
|000000d0| 65 0a 4b 65 79 77 6f 72 | 64 73 3a 20 67 75 6c 61 |e.Keywor|ds: gula|
|000000e0| 6d 2c 20 73 68 65 6c 6c | 0a 44 61 74 65 3a 20 31 |m, shell|.Date: 1|
|000000f0| 39 20 4f 63 74 20 38 38 | 20 32 33 3a 34 37 3a 34 |9 Oct 88| 23:47:4|
|00000100| 37 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |7 GMT.Or|ganizati|
|00000110| 6f 6e 3a 20 4d 79 72 69 | 61 73 20 52 65 73 65 61 |on: Myri|as Resea|
|00000120| 72 63 68 2c 20 45 64 6d | 6f 6e 74 6f 6e 0a 0a 28 |rch, Edm|onton..(|
|00000130| 57 68 61 74 65 76 65 72 | 20 69 73 20 64 65 73 63 |Whatever| is desc|
|00000140| 72 69 62 65 64 20 62 65 | 6c 6f 77 20 77 61 73 20 |ribed be|low was |
|00000150| 63 68 65 63 6b 65 64 20 | 66 6f 72 20 61 20 67 75 |checked |for a gu|
|00000160| 6c 61 6d 20 76 65 72 73 | 69 6f 6e 0a 77 68 69 63 |lam vers|ion.whic|
|00000170| 68 20 69 64 65 6e 74 69 | 66 69 65 73 20 69 74 73 |h identi|fies its|
|00000180| 65 6c 66 20 61 73 3a 0a | 0a 09 62 65 74 61 20 74 |elf as:.|..beta t|
|00000190| 65 73 74 20 76 65 72 73 | 69 6f 6e 20 31 2e 30 33 |est vers|ion 1.03|
|000001a0| 2e 30 34 2e 30 35 20 31 | 32 31 38 38 37 20 6f 66 |.04.05 1|21887 of|
|000001b0| 0a 09 79 65 74 20 61 6e | 6f 74 68 65 72 20 73 68 |..yet an|other sh|
|000001c0| 65 6c 6c 20 66 6f 72 20 | 41 74 61 72 69 53 54 2f |ell for |AtariST/|
|000001d0| 54 4f 53 0a 0a 59 6f 75 | 72 20 6d 69 6c 65 61 67 |TOS..You|r mileag|
|000001e0| 65 20 6d 61 79 20 76 61 | 72 79 21 21 29 0a 0a 20 |e may va|ry!!).. |
|000001f0| 20 20 41 73 20 79 6f 75 | 20 6d 61 79 20 6e 6f 74 | As you| may not|
|00000200| 20 6b 6e 6f 77 2c 20 61 | 20 76 65 72 79 20 70 6f | know, a| very po|
|00000210| 70 75 6c 61 72 20 47 75 | 6c 61 6d 20 73 68 65 6c |pular Gu|lam shel|
|00000220| 6c 20 28 6d 61 6e 79 20 | 74 68 61 6e 6b 73 20 74 |l (many |thanks t|
|00000230| 6f 0a 50 72 61 62 68 61 | 6b 65 72 20 4d 61 74 65 |o.Prabha|ker Mate|
|00000240| 74 69 20 61 6e 64 20 4a | 77 61 68 61 72 20 52 2e |ti and J|wahar R.|
|00000250| 20 42 61 6d 6d 69 29 2e | 20 69 6e 63 6c 75 64 65 | Bammi).| include|
|00000260| 73 20 71 75 69 74 65 20 | 70 6f 77 65 72 66 75 6c |s quite |powerful|
|00000270| 20 66 61 63 69 6c 69 74 | 79 0a 74 6f 20 69 6e 76 | facilit|y.to inv|
|00000280| 6f 6b 65 20 67 75 6c 61 | 6d 20 73 65 72 76 69 63 |oke gula|m servic|
|00000290| 65 73 20 66 72 6f 6d 20 | 61 20 70 72 6f 67 72 61 |es from |a progra|
|000002a0| 6d 20 73 74 61 72 74 65 | 64 20 66 72 6f 6d 20 67 |m starte|d from g|
|000002b0| 75 6c 61 6d 2e 20 20 49 | 6e 20 63 6f 6e 74 72 61 |ulam. I|n contra|
|000002c0| 73 74 0a 74 6f 20 6d 61 | 6e 79 20 6f 74 68 65 72 |st.to ma|ny other|
|000002d0| 73 20 73 68 65 6c 6c 73 | 20 66 6c 6f 61 74 69 6e |s shells| floatin|
|000002e0| 67 20 61 72 6f 75 6e 67 | 20 74 68 69 73 20 69 73 |g aroung| this is|
|000002f0| 20 6e 6f 74 20 64 6f 6e | 65 20 62 79 20 65 78 65 | not don|e by exe|
|00000300| 63 75 74 69 6e 67 0a 74 | 68 65 20 6e 65 78 74 20 |cuting.t|he next |
|00000310| 69 6e 63 61 72 6e 61 74 | 69 6f 6e 20 6f 66 20 67 |incarnat|ion of g|
|00000320| 75 6c 61 6d 2e 20 49 6e | 73 74 65 61 64 20 74 68 |ulam. In|stead th|
|00000330| 65 72 65 20 61 72 65 20 | 70 72 6f 76 69 64 65 64 |ere are |provided|
|00000340| 20 74 77 6f 20 70 6f 69 | 6e 74 65 72 73 0a 77 68 | two poi|nters.wh|
|00000350| 69 63 68 20 70 72 6f 76 | 69 64 65 20 65 78 65 63 |ich prov|ide exec|
|00000360| 75 74 69 6f 6e 20 27 68 | 6f 6f 6b 73 27 20 66 6f |ution 'h|ooks' fo|
|00000370| 72 20 61 6c 6c 20 67 75 | 6c 61 6d 20 63 6f 6d 6d |r all gu|lam comm|
|00000380| 61 6e 64 73 2e 20 20 41 | 20 62 72 69 67 68 74 20 |ands. A| bright |
|00000390| 73 69 67 68 74 0a 69 73 | 20 74 68 61 74 20 74 68 |sight.is| that th|
|000003a0| 69 73 20 61 70 70 72 6f | 61 63 68 20 64 6f 65 73 |is appro|ach does|
|000003b0| 20 6e 6f 74 20 74 61 6b | 65 20 61 6e 79 20 65 78 | not tak|e any ex|
|000003c0| 74 72 61 20 6d 65 6d 6f | 72 79 20 61 6e 64 20 61 |tra memo|ry and a|
|000003d0| 20 73 74 61 72 74 2d 75 | 70 0a 74 69 6d 65 20 69 | start-u|p.time i|
|000003e0| 73 20 6e 65 67 6c 69 67 | 69 62 6c 65 2e 20 41 20 |s neglig|ible. A |
|000003f0| 64 61 72 6b 20 73 69 64 | 65 20 69 73 20 74 68 61 |dark sid|e is tha|
|00000400| 74 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 20 |t docume|ntation |
|00000410| 64 65 73 63 72 69 62 69 | 6e 67 20 74 68 69 73 0a |describi|ng this.|
|00000420| 66 61 63 69 6c 69 74 79 | 20 69 73 20 65 69 74 68 |facility| is eith|
|00000430| 65 72 20 6d 69 73 6c 65 | 61 64 69 6e 67 20 6f 72 |er misle|ading or|
|00000440| 20 70 6c 61 69 6e 6c 79 | 20 77 72 6f 6e 67 2e 20 | plainly| wrong. |
|00000450| 20 28 41 73 20 61 6e 20 | 61 73 69 64 65 20 2d 20 | (As an |aside - |
|00000460| 74 68 69 73 0a 69 73 2c | 20 61 6c 61 73 2c 20 6e |this.is,| alas, n|
|00000470| 6f 74 20 74 68 65 20 6f | 6e 6c 79 20 70 6c 61 63 |ot the o|nly plac|
|00000480| 65 20 69 6e 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 |e in doc|umentati|
|00000490| 6f 6e 20 72 65 71 75 69 | 72 69 6e 67 20 74 6f 75 |on requi|ring tou|
|000004a0| 63 68 2d 75 70 2e 0a 46 | 6f 72 20 74 68 69 73 20 |ch-up..F|or this |
|000004b0| 76 65 72 73 69 6f 6e 2c | 20 67 75 6c 61 6d 2e 68 |version,| gulam.h|
|000004c0| 6c 70 2c 20 66 6f 72 20 | 65 78 61 6d 70 6c 65 2c |lp, for |example,|
|000004d0| 20 64 6f 65 73 20 6e 6f | 74 20 63 6f 72 72 65 73 | does no|t corres|
|000004e0| 70 6f 6e 64 20 76 65 72 | 79 20 77 65 6c 6c 0a 74 |pond ver|y well.t|
|000004f0| 70 20 72 65 61 6c 69 74 | 79 29 2e 0a 0a 20 20 20 |p realit|y)... |
|00000500| 54 68 69 73 20 6e 6f 74 | 65 20 69 73 20 61 20 6b |This not|e is a k|
|00000510| 69 6e 64 20 6f 66 20 65 | 72 72 61 74 75 6d 2c 20 |ind of e|rratum, |
|00000520| 77 68 69 63 68 2c 20 68 | 6f 70 65 66 75 6c 79 2c |which, h|opefuly,|
|00000530| 20 77 69 6c 6c 20 68 65 | 6c 70 20 74 6f 20 63 6c | will he|lp to cl|
|00000540| 61 72 69 66 79 0a 61 6e | 20 65 6e 73 75 69 6e 67 |arify.an| ensuing|
|00000550| 20 63 6f 6e 66 75 73 69 | 6f 6e 2c 20 77 68 69 63 | confusi|on, whic|
|00000560| 68 20 73 65 65 6d 73 20 | 74 6f 20 62 65 20 71 75 |h seems |to be qu|
|00000570| 69 74 65 20 77 69 64 65 | 73 70 72 65 61 64 2e 0a |ite wide|spread..|
|00000580| 0a 20 20 20 57 68 65 6e | 20 79 6f 75 20 61 72 65 |. When| you are|
|00000590| 20 72 75 6e 6e 69 6e 67 | 20 47 75 6c 61 6d 20 61 | running| Gulam a|
|000005a0| 20 54 4f 53 20 76 61 72 | 69 61 62 6c 65 20 27 5f | TOS var|iable '_|
|000005b0| 73 68 65 6c 6c 5f 70 27 | 2c 20 61 74 20 30 78 34 |shell_p'|, at 0x4|
|000005c0| 66 36 2c 0a 63 6f 6e 74 | 61 69 6e 73 20 61 6e 20 |f6,.cont|ains an |
|000005d0| 61 64 64 72 65 73 73 20 | 6f 66 20 61 20 6c 6f 63 |address |of a loc|
|000005e0| 61 74 69 6f 6e 20 6e 61 | 6d 65 64 20 27 74 6f 67 |ation na|med 'tog|
|000005f0| 75 5f 27 2c 20 77 68 69 | 63 68 20 69 73 20 74 68 |u_', whi|ch is th|
|00000600| 65 20 6c 61 73 74 20 65 | 6e 74 72 79 0a 69 6e 20 |e last e|ntry.in |
|00000610| 61 20 31 36 20 62 79 74 | 65 20 6c 6f 6e 67 20 74 |a 16 byt|e long t|
|00000620| 61 62 6c 65 2e 20 54 68 | 65 20 66 6f 72 6d 61 74 |able. Th|e format|
|00000630| 20 6f 66 20 74 68 65 20 | 74 61 62 6c 65 20 69 73 | of the |table is|
|00000640| 20 28 74 68 69 73 20 69 | 73 20 6d 6f 73 74 6c 79 | (this i|s mostly|
|00000650| 20 71 75 6f 74 65 64 0a | 66 72 6f 6d 20 74 68 65 | quoted.|from the|
|00000660| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 29 3a | documen|tation):|
|00000670| 0a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00000680| 20 2e 6c 6f 6e 67 20 20 | 20 30 78 38 36 34 32 30 | .long | 0x86420|
|00000690| 31 33 35 20 20 20 20 20 | 20 20 20 2f 20 6f 75 72 |135 | / our|
|000006a0| 20 6d 61 67 69 63 20 6e | 75 6d 62 65 72 20 28 34 | magic n|umber (4|
|000006b0| 20 62 79 74 65 73 29 0a | 20 20 20 20 20 20 20 20 | bytes).| |
|000006c0| 20 20 20 20 20 20 20 6a | 6d 70 20 20 20 20 20 67 | j|mp g|
|000006d0| 65 74 6c 69 6e 65 76 69 | 61 75 65 5f 20 20 20 20 |etlinevi|aue_ |
|000006e0| 20 2f 20 30 78 34 65 66 | 39 2c 61 64 64 72 65 73 | / 0x4ef|9,addres|
|000006f0| 73 20 20 20 28 36 20 62 | 79 74 65 73 29 0a 20 20 |s (6 b|ytes). |
|00000700| 20 20 20 20 20 74 6f 67 | 75 5f 3a 20 20 6a 6d 70 | tog|u_: jmp|
|00000710| 20 20 20 20 20 63 61 6c | 6c 67 75 6c 61 6d 5f 20 | cal|lgulam_ |
|00000720| 20 20 20 20 20 20 20 2f | 20 30 78 34 65 66 39 2c | /| 0x4ef9,|
|00000730| 61 64 64 72 65 73 73 20 | 20 20 28 36 20 62 79 74 |address | (6 byt|
|00000740| 65 73 29 0a 0a 49 74 20 | 63 6c 65 61 72 6c 79 20 |es)..It |clearly |
|00000750| 66 6f 6c 6c 6f 77 73 20 | 66 72 6f 6d 20 74 68 61 |follows |from tha|
|00000760| 74 20 74 68 61 74 20 6d | 61 67 69 63 20 6e 75 6d |t that m|agic num|
|00000770| 62 65 72 20 69 73 20 6c | 6f 63 61 74 65 64 20 31 |ber is l|ocated 1|
|00000780| 30 20 62 79 74 65 73 20 | 62 65 66 6f 72 65 0a 27 |0 bytes |before.'|
|00000790| 74 6f 67 75 5f 27 20 61 | 6e 64 20 6e 6f 74 2c 20 |togu_' a|nd not, |
|000007a0| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 61 74 69 6f |the docu|mentatio|
|000007b0| 6e 20 73 75 67 67 65 73 | 74 65 64 2c 20 31 32 2e |n sugges|ted, 12.|
|000007c0| 20 20 57 68 61 74 27 73 | 20 6d 6f 72 65 2c 20 74 | What's| more, t|
|000007d0| 68 65 20 6d 61 67 69 63 | 20 0a 6e 75 6d 62 65 72 |he magic| .number|
|000007e0| 20 73 68 6f 75 6c 64 20 | 62 65 20 65 71 75 61 6c | should |be equal|
|000007f0| 20 2a 28 6c 6f 6e 67 20 | 2a 29 28 2a 28 63 68 61 | *(long |*)(*(cha|
|00000800| 72 20 2a 2a 29 30 78 34 | 66 36 20 2d 20 31 30 29 |r **)0x4|f6 - 10)|
|00000810| 2c 20 69 6e 73 74 65 61 | 64 20 6f 66 20 61 0a 67 |, instea|d of a.g|
|00000820| 69 76 65 6e 20 2a 28 28 | 6c 6f 6e 67 20 2a 29 30 |iven *((|long *)0|
|00000830| 78 34 36 66 4c 20 2d 20 | 31 32 4c 29 2c 20 77 68 |x46fL - |12L), wh|
|00000840| 69 63 68 20 77 69 6c 6c | 20 70 72 6f 64 75 63 65 |ich will| produce|
|00000850| 20 61 20 76 61 6c 75 65 | 20 66 72 6f 6d 20 61 6e | a value| from an|
|00000860| 20 61 64 64 72 65 73 73 | 0a 77 61 79 20 6f 66 66 | address|.way off|
|00000870| 2e 20 20 4f 6e 20 74 68 | 65 20 74 6f 70 20 6f 66 |. On th|e top of|
|00000880| 20 69 74 2c 20 61 6e 20 | 61 63 74 75 61 6c 20 6d | it, an |actual m|
|00000890| 61 67 69 63 20 6e 75 6d | 62 65 72 20 69 6e 20 6d |agic num|ber in m|
|000008a0| 79 20 63 6f 70 79 20 6f | 66 20 47 75 6c 61 6d 0a |y copy o|f Gulam.|
|000008b0| 69 73 20 6e 6f 74 20 6c | 69 6b 65 20 74 68 65 20 |is not l|ike the |
|000008c0| 64 6f 63 75 6d 65 6e 74 | 65 64 20 62 75 74 20 69 |document|ed but i|
|000008d0| 74 20 65 71 75 61 6c 73 | 20 30 78 30 30 34 32 30 |t equals| 0x00420|
|000008e0| 31 33 35 2e 20 20 55 73 | 65 20 47 75 6c 61 6d 20 |135. Us|e Gulam |
|000008f0| 27 70 65 65 6b 77 27 0a | 74 6f 20 63 68 65 63 6b |'peekw'.|to check|
|00000900| 20 77 68 61 74 20 79 6f | 75 20 67 6f 74 2e 20 54 | what yo|u got. T|
|00000910| 6f 20 62 65 20 6f 6e 20 | 61 20 73 61 66 65 20 73 |o be on |a safe s|
|00000920| 69 64 65 2c 20 75 6e 74 | 69 6c 20 74 68 65 20 6d |ide, unt|il the m|
|00000930| 61 74 74 65 72 0a 69 73 | 20 66 75 6c 6c 79 20 63 |atter.is| fully c|
|00000940| 6c 61 72 69 66 69 65 64 | 2c 20 49 20 61 6d 20 75 |larified|, I am u|
|00000950| 73 69 6e 67 20 6f 6e 6c | 79 20 61 20 6c 6f 77 65 |sing onl|y a lowe|
|00000960| 72 20 68 61 6c 66 20 6f | 66 20 74 68 65 20 6d 61 |r half o|f the ma|
|00000970| 67 69 63 20 6e 75 6d 62 | 65 72 2c 0a 77 68 69 63 |gic numb|er,.whic|
|00000980| 68 20 73 65 65 6d 73 20 | 74 6f 20 62 65 20 63 6f |h seems |to be co|
|00000990| 72 72 65 63 74 3b 20 69 | 2e 65 2e 20 73 68 6f 72 |rrect; i|.e. shor|
|000009a0| 74 5f 6d 61 67 69 63 20 | 3d 20 2a 28 73 68 6f 72 |t_magic |= *(shor|
|000009b0| 74 20 2a 29 28 2a 28 63 | 68 61 72 20 2a 2a 29 30 |t *)(*(c|har **)0|
|000009c0| 78 34 66 36 2d 38 29 2e | 0a 0a 20 20 54 77 6f 20 |x4f6-8).|.. Two |
|000009d0| 6f 74 68 65 72 20 69 74 | 65 6d 73 20 69 6e 20 74 |other it|ems in t|
|000009e0| 68 65 20 74 61 62 6c 65 | 20 61 72 65 20 65 6e 74 |he table| are ent|
|000009f0| 72 79 20 70 6f 69 6e 74 | 73 20 74 6f 20 74 77 6f |ry point|s to two|
|00000a00| 20 66 75 6e 63 74 69 6f | 6e 73 0a 27 67 65 74 6c | functio|ns.'getl|
|00000a10| 69 6e 65 76 69 61 75 65 | 27 20 61 6e 64 20 27 63 |ineviaue|' and 'c|
|00000a20| 61 6c 6c 67 75 6c 61 6d | 27 2e 20 20 54 68 65 20 |allgulam|'. The |
|00000a30| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 67 69 76 65 |informat|ion give|
|00000a40| 6e 20 69 6e 20 74 68 65 | 20 64 6f 63 75 6d 65 6e |n in the| documen|
|00000a50| 74 61 74 69 6f 6e 0a 61 | 62 6f 75 74 20 74 68 65 |tation.a|bout the|
|00000a60| 6d 20 69 73 20 6d 6f 73 | 74 6c 79 20 63 6f 72 72 |m is mos|tly corr|
|00000a70| 65 63 74 2c 20 77 69 74 | 68 20 61 20 73 69 6d 69 |ect, wit|h a simi|
|00000a80| 6c 61 72 20 6d 69 78 2d | 75 70 20 69 6e 20 61 20 |lar mix-|up in a |
|00000a90| 63 61 6c 63 75 6c 61 74 | 69 6f 6e 0a 6f 66 20 61 |calculat|ion.of a|
|00000aa0| 6e 20 61 64 64 72 65 73 | 73 20 6f 66 20 65 6e 74 |n addres|s of ent|
|00000ab0| 72 79 20 74 6f 20 27 67 | 65 74 6c 69 6e 65 76 69 |ry to 'g|etlinevi|
|00000ac0| 61 75 65 27 2c 20 6c 69 | 6b 65 20 74 68 65 20 6f |aue', li|ke the o|
|00000ad0| 6e 65 20 64 65 73 63 72 | 69 62 65 64 20 61 62 6f |ne descr|ibed abo|
|00000ae0| 76 65 2e 0a 41 6c 73 6f | 2c 20 73 74 72 69 63 74 |ve..Also|, strict|
|00000af0| 6c 79 20 73 70 65 61 6b | 69 6e 67 2c 20 27 67 65 |ly speak|ing, 'ge|
|00000b00| 74 6c 69 6e 65 76 61 6c | 75 65 27 20 64 6f 65 73 |tlineval|ue' does|
|00000b10| 20 6e 6f 74 20 72 65 74 | 75 72 6e 20 61 6e 79 74 | not ret|urn anyt|
|00000b20| 68 69 6e 67 2c 20 73 69 | 6e 63 65 0a 69 74 20 69 |hing, si|nce.it i|
|00000b30| 73 20 64 65 63 6c 61 72 | 65 64 20 61 73 20 27 76 |s declar|ed as 'v|
|00000b40| 6f 69 64 27 2e 20 41 73 | 20 61 20 73 69 64 65 20 |oid'. As| a side |
|00000b50| 65 66 66 65 63 74 20 69 | 74 20 6d 6f 64 69 66 69 |effect i|t modifi|
|00000b60| 65 73 20 61 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 |es a con|tents of|
|00000b70| 0a 61 20 75 73 65 72 20 | 73 75 70 70 6c 69 65 64 |.a user |supplied|
|00000b80| 20 62 75 66 66 65 72 2c | 20 63 6f 70 79 69 6e 67 | buffer,| copying|
|00000b90| 20 74 68 65 72 65 20 61 | 20 63 6f 6e 74 65 6e 74 | there a| content|
|00000ba0| 73 20 6f 66 20 61 20 63 | 6f 6d 6d 61 6e 64 20 6c |s of a c|ommand l|
|00000bb0| 69 6e 65 2e 20 49 74 0a | 77 6f 75 6c 64 20 62 65 |ine. It.|would be|
|00000bc0| 20 70 72 6f 62 61 62 6c | 79 20 6d 6f 72 65 20 63 | probabl|y more c|
|00000bd0| 6f 6e 76 65 6e 69 65 6e | 74 20 69 66 2c 20 69 6e |onvenien|t if, in|
|00000be0| 73 74 65 61 64 20 6f 66 | 20 62 65 69 6e 67 20 76 |stead of| being v|
|00000bf0| 6f 69 64 2c 20 69 74 20 | 77 6f 75 6c 64 20 72 65 |oid, it |would re|
|00000c00| 74 75 72 6e 0a 73 6f 6d | 65 74 68 69 6e 67 20 75 |turn.som|ething u|
|00000c10| 73 65 66 75 6c 2c 20 73 | 61 79 20 61 20 6e 75 6d |seful, s|ay a num|
|00000c20| 62 65 72 20 6f 66 20 63 | 6f 70 69 65 64 20 63 68 |ber of c|opied ch|
|00000c30| 61 72 61 63 74 65 72 73 | 2c 20 62 75 74 20 69 74 |aracters|, but it|
|00000c40| 20 64 6f 65 73 6e 27 74 | 2c 0a 73 6f 20 77 65 20 | doesn't|,.so we |
|00000c50| 6d 61 79 20 68 61 76 65 | 20 74 6f 20 6c 69 76 65 |may have| to live|
|00000c60| 20 77 69 74 68 20 74 68 | 61 74 2e 20 20 4a 75 73 | with th|at. Jus|
|00000c70| 74 20 74 6f 20 6d 61 6b | 65 20 6f 75 72 20 6c 69 |t to mak|e our li|
|00000c80| 66 65 20 6d 6f 72 65 0a | 69 6e 74 65 72 65 73 74 |fe more.|interest|
|00000c90| 69 6e 67 2c 20 74 68 65 | 20 6f 74 68 65 72 20 66 |ing, the| other f|
|00000ca0| 75 6e 63 74 69 6f 6e 2c | 20 27 63 61 6c 6c 67 75 |unction,| 'callgu|
|00000cb0| 6c 61 6d 27 2c 20 72 65 | 74 75 72 6e 73 20 27 69 |lam', re|turns 'i|
|00000cc0| 6e 74 27 20 2d 20 74 68 | 65 20 72 65 74 75 72 6e |nt' - th|e return|
|00000cd0| 0a 73 74 61 74 75 73 20 | 6f 66 20 61 6e 20 65 78 |.status |of an ex|
|00000ce0| 65 63 75 74 65 64 20 63 | 6f 6d 6d 61 6e 64 2e 20 |ecuted c|ommand. |
|00000cf0| 20 54 68 69 73 20 6d 61 | 6b 65 73 20 77 6f 6e 64 | This ma|kes wond|
|00000d00| 65 72 73 20 74 6f 20 74 | 79 70 65 73 20 6f 66 20 |ers to t|ypes of |
|00000d10| 79 6f 75 72 0a 70 6f 69 | 6e 74 65 72 73 2e 20 20 |your.poi|nters. |
|00000d20| 53 65 65 20 74 68 65 20 | 73 75 70 70 6c 69 65 64 |See the |supplied|
|00000d30| 20 70 72 6f 67 72 61 6d | 20 65 78 61 6d 70 6c 65 | program| example|
|00000d40| 20 66 6f 72 20 74 6f 20 | 73 65 65 20 68 6f 77 20 | for to |see how |
|00000d50| 74 6f 20 63 61 73 74 2e | 0a 41 6c 6c 20 6f 66 20 |to cast.|.All of |
|00000d60| 74 68 69 73 20 74 6f 20 | 65 6e 73 75 72 65 20 74 |this to |ensure t|
|00000d70| 68 61 74 20 79 6f 75 72 | 20 43 2d 63 6f 6d 70 69 |hat your| C-compi|
|00000d80| 6c 65 72 20 77 69 6c 6c | 20 6e 6f 74 20 67 65 74 |ler will| not get|
|00000d90| 20 74 6f 74 61 6c 6c 79 | 20 6c 6f 73 74 2e 0a 49 | totally| lost..I|
|00000da0| 66 20 79 6f 75 20 68 61 | 76 65 20 61 20 63 6f 6d |f you ha|ve a com|
|00000db0| 70 69 6c 65 72 20 77 68 | 69 63 68 20 61 63 63 65 |piler wh|ich acce|
|00000dc0| 70 74 73 20 74 68 65 20 | 73 74 75 66 66 20 69 6e |pts the |stuff in|
|00000dd0| 20 61 20 66 6f 72 6d 20 | 66 72 6f 6d 20 61 6e 20 | a form |from an |
|00000de0| 6f 72 69 67 69 6e 61 6c | 0a 64 6f 63 73 20 2d 20 |original|.docs - |
|00000df0| 72 65 70 6c 61 63 65 20 | 79 6f 75 72 20 63 6f 6d |replace |your com|
|00000e00| 70 69 6c 65 72 2e 20 46 | 61 73 74 21 0a 28 41 73 |piler. F|ast!.(As|
|00000e10| 20 61 6e 20 61 73 69 64 | 65 20 2d 20 61 6c 6c 20 | an asid|e - all |
|00000e20| 74 68 69 73 20 70 6f 69 | 6e 74 65 72 20 70 6c 61 |this poi|nter pla|
|00000e30| 79 20 77 6f 75 6c 64 20 | 62 65 20 65 61 73 69 65 |y would |be easie|
|00000e40| 72 20 69 6e 20 61 73 73 | 65 6d 62 6c 65 72 2c 20 |r in ass|embler, |
|00000e50| 0a 69 66 20 79 6f 75 20 | 66 65 65 6c 20 73 6f 20 |.if you |feel so |
|00000e60| 69 6e 63 6c 69 6e 65 64 | 29 2e 0a 0a 20 20 57 68 |inclined|)... Wh|
|00000e70| 69 6c 65 20 65 78 70 65 | 72 69 6d 65 6e 74 69 6e |ile expe|rimentin|
|00000e80| 67 20 77 68 69 74 68 20 | 74 68 65 20 70 72 6f 67 |g whith |the prog|
|00000e90| 72 61 6d 20 65 78 61 6d | 70 6c 65 20 74 72 79 20 |ram exam|ple try |
|00000ea0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 2e 0a 43 |the foll|owing..C|
|00000eb0| 61 6c 6c 20 27 75 65 27 | 20 6f 6e 20 73 6f 6d 65 |all 'ue'| on some|
|00000ec0| 20 66 69 6c 65 2c 20 70 | 6f 73 69 74 69 6f 6e 20 | file, p|osition |
|00000ed0| 63 75 72 73 6f 72 20 73 | 6f 6d 65 77 68 65 72 20 |cursor s|omewher |
|00000ee0| 64 6f 77 6e 20 74 68 65 | 20 74 65 78 74 20 61 6e |down the| text an|
|00000ef0| 64 0a 73 74 6f 70 20 65 | 64 69 74 6f 72 20 77 69 |d.stop e|ditor wi|
|00000f00| 74 68 20 5e 5a 2e 20 54 | 72 79 20 73 6f 6d 65 20 |th ^Z. T|ry some |
|00000f10| 6f 74 68 65 72 20 63 6f | 6d 6d 61 6e 64 73 20 61 |other co|mmands a|
|00000f20| 6e 64 20 75 70 6f 6e 20 | 72 65 74 75 72 6e 20 74 |nd upon |return t|
|00000f30| 6f 20 47 75 6c 61 6d 0a | 74 79 70 65 20 27 66 67 |o Gulam.|type 'fg|
|00000f40| 27 2e 20 20 52 65 70 65 | 61 74 20 65 78 70 65 72 |'. Repe|at exper|
|00000f50| 69 6d 65 6e 74 20 73 74 | 6f 70 70 69 6e 67 20 74 |iment st|opping t|
|00000f60| 68 65 20 65 64 69 74 6f | 72 20 69 6e 20 47 75 6c |he edito|r in Gul|
|00000f70| 61 6d 20 61 6e 64 20 74 | 79 70 69 6e 67 0a 27 66 |am and t|yping.'f|
|00000f80| 67 27 20 66 72 6f 6d 20 | 74 68 65 20 64 65 6d 6f |g' from |the demo|
|00000f90| 20 70 72 6f 67 72 61 6d | 20 70 72 6f 6d 70 74 2e | program| prompt.|
|00000fa0| 20 44 6f 6e 27 74 20 79 | 6f 75 20 74 68 69 6e 6b | Don't y|ou think|
|00000fb0| 20 74 68 61 74 20 74 68 | 69 73 20 69 73 20 61 20 | that th|is is a |
|00000fc0| 6e 69 63 65 0a 77 61 79 | 20 74 6f 20 72 75 6e 20 |nice.way| to run |
|00000fd0| 65 64 69 74 6f 72 20 66 | 6f 72 20 79 6f 75 72 2c |editor f|or your,|
|00000fe0| 20 73 61 79 2c 20 4c 69 | 73 70 20 69 6e 74 65 72 | say, Li|sp inter|
|00000ff0| 70 72 65 74 65 72 3f 0a | 0a 20 20 53 6f 6d 65 20 |preter?.|. Some |
|00001000| 74 68 69 6e 67 73 20 61 | 72 65 20 73 74 69 6c 6c |things a|re still|
|00001010| 20 6d 69 73 73 69 6e 67 | 2e 20 4f 6e 65 20 63 61 | missing|. One ca|
|00001020| 6e 6e 6f 74 20 74 65 6c | 6c 20 27 75 65 27 2c 20 |nnot tel|l 'ue', |
|00001030| 6f 6e 20 61 20 63 6f 6d | 6d 61 6e 64 0a 6c 69 6e |on a com|mand.lin|
|00001040| 65 2c 20 74 6f 20 6c 6f | 61 64 20 61 20 66 69 6c |e, to lo|ad a fil|
|00001050| 65 20 61 6e 64 20 67 6f | 20 74 6f 20 74 68 65 20 |e and go| to the |
|00001060| 6c 69 6e 65 20 32 34 37 | 2e 20 20 4f 72 20 74 68 |line 247|. Or th|
|00001070| 65 72 65 20 69 73 20 61 | 20 77 61 79 20 61 6e 64 |ere is a| way and|
|00001080| 20 49 0a 61 6d 20 73 69 | 6d 70 6c 79 20 6e 6f 74 | I.am si|mply not|
|00001090| 20 61 77 61 72 65 20 6f | 66 20 69 74 3f 20 20 41 | aware o|f it? A|
|000010a0| 6e 64 20 49 20 6b 6e 6f | 77 20 6f 66 20 6e 6f 20 |nd I kno|w of no |
|000010b0| 77 61 79 20 74 6f 20 67 | 72 61 62 20 61 20 72 65 |way to g|rab a re|
|000010c0| 73 75 6c 74 20 6f 66 0a | 61 20 63 6f 6d 6d 61 6e |sult of.|a comman|
|000010d0| 64 2c 20 73 74 75 66 66 | 20 69 74 20 69 6e 74 6f |d, stuff| it into|
|000010e0| 20 61 20 76 61 72 69 61 | 62 6c 65 20 61 6e 64 20 | a varia|ble and |
|000010f0| 75 73 65 20 69 74 20 66 | 6f 72 20 61 20 74 65 73 |use it f|or a tes|
|00001100| 74 20 6f 66 20 63 6f 6e | 64 69 74 69 6f 6e 61 6c |t of con|ditional|
|00001110| 0a 73 63 72 69 70 74 20 | 65 78 65 63 75 74 69 6f |.script |executio|
|00001120| 6e 2e 20 20 4f 68 20 77 | 65 6c 6c 2c 20 6d 61 79 |n. Oh w|ell, may|
|00001130| 62 65 20 69 6e 20 73 6f | 6d 65 20 66 75 74 75 72 |be in so|me futur|
|00001140| 65 20 72 65 6c 65 61 73 | 65 2e 2e 2e 0a 0a 20 20 |e releas|e..... |
|00001150| 54 77 6f 20 6f 74 68 65 | 72 2c 20 6e 6f 6e 2d 69 |Two othe|r, non-i|
|00001160| 6e 74 65 72 61 63 74 69 | 76 65 2c 20 77 61 79 73 |nteracti|ve, ways|
|00001170| 20 6f 66 20 63 61 6c 6c | 69 6e 67 20 47 75 6c 61 | of call|ing Gula|
|00001180| 6d 20 61 72 65 20 61 6c | 73 6f 20 6d 65 6e 74 69 |m are al|so menti|
|00001190| 6f 6e 65 64 0a 69 6e 20 | 64 6f 63 73 2e 20 20 49 |oned.in |docs. I|
|000011a0| 20 64 69 64 20 6e 6f 74 | 20 74 72 79 20 27 50 65 | did not| try 'Pe|
|000011b0| 78 65 63 20 6d 65 74 68 | 6f 64 27 2c 20 62 75 74 |xec meth|od', but|
|000011c0| 20 61 74 74 65 6d 70 74 | 73 20 74 6f 20 65 78 65 | attempt|s to exe|
|000011d0| 63 75 74 65 20 0a 67 75 | 6c 61 6d 20 61 73 20 61 |cute .gu|lam as a|
|000011e0| 20 70 72 6f 67 72 61 6d | 20 77 69 74 68 20 61 72 | program| with ar|
|000011f0| 67 75 6d 65 6e 74 73 2c | 20 61 73 20 64 65 73 63 |guments,| as desc|
|00001200| 72 69 62 65 64 2c 20 70 | 72 6f 64 75 63 65 64 20 |ribed, p|roduced |
|00001210| 6f 6e 6c 79 0a 6e 6f 6e | 73 65 6e 73 69 63 61 6c |only.non|sensical|
|00001220| 20 65 72 72 6f 72 20 6d | 65 73 73 61 67 65 73 20 | error m|essages |
|00001230| 61 62 6f 75 74 20 27 69 | 6e 76 61 6c 69 64 20 72 |about 'i|nvalid r|
|00001240| 65 67 65 78 70 27 20 61 | 6e 64 20 65 72 72 6f 72 |egexp' a|nd error|
|00001250| 20 6e 75 6d 62 65 72 20 | 2d 33 33 2e 0a 43 61 6e | number |-33..Can|
|00001260| 20 61 6e 79 62 6f 64 79 | 20 73 68 65 64 20 73 6f | anybody| shed so|
|00001270| 6d 65 20 6c 69 67 68 74 | 20 6f 6e 20 74 68 61 74 |me light| on that|
|00001280| 20 6d 61 74 74 65 72 3f | 0a 0a 0a 20 20 20 4d 69 | matter?|... Mi|
|00001290| 63 68 61 6c 20 4a 61 65 | 67 65 72 6d 61 6e 6e 0a |chal Jae|germann.|
|000012a0| 20 20 20 4d 79 72 69 61 | 73 20 52 65 73 65 61 72 | Myria|s Resear|
|000012b0| 63 68 20 43 6f 72 70 6f | 72 61 74 69 6f 6e 0a 20 |ch Corpo|ration. |
|000012c0| 20 20 45 64 6d 6f 6e 74 | 6f 6e 2c 20 41 6c 62 65 | Edmont|on, Albe|
|000012d0| 72 74 61 2c 20 43 41 4e | 41 44 41 0a 20 20 20 2e |rta, CAN|ADA. .|
|000012e0| 2e 2e 61 6c 62 65 72 74 | 61 21 6d 79 72 69 61 73 |..albert|a!myrias|
|000012f0| 21 6d 6a 0a 20 20 20 28 | 6f 72 20 79 6f 75 20 6d |!mj. (|or you m|
|00001300| 61 79 20 74 72 79 20 6d | 6a 40 6d 79 72 69 61 73 |ay try m|j@myrias|
|00001310| 2e 55 55 43 50 29 0a 0a | 2d 2d 2d 2d 2d 2d 2d 2d |.UUCP)..|--------|
|00001320| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001330| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001340| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001350| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001360| 2d 2d 2d 2d 2d 2d 0a 0a | 2f 2a 20 0a 2a 20 41 20 |------..|/* .* A |
|00001370| 64 65 6d 6f 20 70 72 6f | 67 72 61 6d 20 74 6f 20 |demo pro|gram to |
|00001380| 73 68 6f 77 20 61 20 75 | 73 61 67 65 20 6f 66 20 |show a u|sage of |
|00001390| 47 75 6c 61 6d 20 27 68 | 6f 6f 6b 73 27 20 2d 20 |Gulam 'h|ooks' - |
|000013a0| 63 61 6c 6c 20 66 72 6f | 6d 0a 2a 20 47 75 6c 61 |call fro|m.* Gula|
|000013b0| 6d 20 73 68 65 6c 6c 21 | 20 20 57 68 65 6e 20 61 |m shell!| When a|
|000013c0| 73 6b 65 64 2c 20 74 72 | 79 20 64 69 66 66 65 72 |sked, tr|y differ|
|000013d0| 65 6e 74 20 67 75 6c 61 | 6d 20 63 6f 6d 6d 61 6e |ent gula|m comman|
|000013e0| 64 73 2c 20 75 65 0a 2a | 20 69 6e 20 70 61 72 74 |ds, ue.*| in part|
|000013f0| 69 63 75 6c 61 72 2e 0a | 2a 0a 2a 20 41 20 6e 75 |icular..|*.* A nu|
|00001400| 6d 62 65 72 73 20 6f 66 | 20 70 6f 69 6e 74 65 72 |mbers of| pointer|
|00001410| 73 20 66 6c 6f 61 74 69 | 6e 67 20 61 72 6f 75 6e |s floati|ng aroun|
|00001420| 64 20 69 73 20 61 20 6c | 69 74 74 6c 65 20 62 69 |d is a l|ittle bi|
|00001430| 74 20 68 69 67 68 65 72 | 0a 2a 20 74 68 61 6e 20 |t higher|.* than |
|00001440| 6e 65 63 65 73 73 61 72 | 79 2c 20 62 75 74 20 77 |necessar|y, but w|
|00001450| 65 20 77 69 6c 6c 20 77 | 61 69 73 74 65 20 73 6f |e will w|aiste so|
|00001460| 6d 65 20 6d 65 6d 6f 72 | 65 20 66 6f 72 20 74 68 |me memor|e for th|
|00001470| 65 20 73 61 6b 65 0a 2a | 20 6f 66 20 63 6c 61 72 |e sake.*| of clar|
|00001480| 69 74 79 2e 0a 2a 0a 2a | 20 4d 69 63 68 61 6c 20 |ity..*.*| Michal |
|00001490| 4a 61 65 67 65 72 6d 61 | 6e 6e 2c 20 4f 63 74 6f |Jaegerma|nn, Octo|
|000014a0| 62 65 72 20 31 39 38 38 | 0a 2a 2f 0a 0a 23 69 6e |ber 1988|.*/..#in|
|000014b0| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 0a |clude <s|tdio.h>.|
|000014c0| 23 69 6e 63 6c 75 64 65 | 20 3c 6f 73 62 69 6e 64 |#include| <osbind|
|000014d0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|000014e0| 72 69 6e 67 2e 68 3e 0a | 23 64 65 66 69 6e 65 20 |ring.h>.|#define |
|000014f0| 20 53 48 45 4c 4c 50 20 | 20 20 20 20 20 20 20 20 | SHELLP | |
|00001500| 28 28 63 68 61 72 20 2a | 2a 29 20 30 78 30 34 66 |((char *|*) 0x04f|
|00001510| 36 4c 29 0a 23 64 65 66 | 69 6e 65 20 20 47 5f 4d |6L).#def|ine G_M|
|00001520| 41 47 49 43 20 20 20 20 | 20 20 20 20 30 78 30 31 |AGIC | 0x01|
|00001530| 33 35 0a 0a 6d 61 69 6e | 28 29 0a 7b 0a 20 20 20 |35..main|().{. |
|00001540| 20 20 20 20 6c 6f 6e 67 | 20 73 61 76 65 5f 73 73 | long| save_ss|
|00001550| 70 3b 0a 20 20 20 20 20 | 20 20 73 68 6f 72 74 20 |p;. | short |
|00001560| 73 68 5f 6d 61 67 69 63 | 3b 0a 20 20 20 20 20 20 |sh_magic|;. |
|00001570| 20 63 68 61 72 20 62 75 | 66 5b 32 35 38 5d 3b 0a | char bu|f[258];.|
|00001580| 20 20 20 20 20 20 20 63 | 68 61 72 20 2a 74 67 70 | c|har *tgp|
|00001590| 74 72 3b 20 20 20 20 20 | 20 20 20 20 20 20 20 2f |tr; | /|
|000015a0| 2a 20 73 74 6f 72 61 67 | 65 20 66 6f 72 20 74 6f |* storag|e for to|
|000015b0| 67 75 5f 20 20 20 20 20 | 20 20 20 20 2a 2f 0a 20 |gu_ | */. |
|000015c0| 20 20 20 20 20 20 2f 2a | 20 69 66 20 79 6f 75 20 | /*| if you |
|000015d0| 72 65 61 6c 6c 79 20 77 | 6f 75 6c 64 20 6c 69 6b |really w|ould lik|
|000015e0| 65 20 74 6f 20 68 61 76 | 65 20 69 74 20 72 69 67 |e to hav|e it rig|
|000015f0| 68 74 2c 20 74 68 65 6e | 20 20 20 2a 2f 0a 20 20 |ht, then| */. |
|00001600| 20 20 20 20 20 2f 2a 20 | 74 67 70 74 72 20 73 68 | /* |tgptr sh|
|00001610| 6f 75 6c 64 20 62 65 20 | 61 20 70 6f 69 6e 74 65 |ould be |a pointe|
|00001620| 72 20 74 6f 20 76 6f 69 | 64 20 2d 20 09 09 20 20 |r to voi|d - .. |
|00001630| 20 20 2a 2f 0a 20 20 20 | 20 20 20 20 2f 2a 20 61 | */. | /* a|
|00001640| 20 62 69 74 20 6f 66 20 | 6f 76 65 72 6b 69 6c 6c | bit of |overkill|
|00001650| 20 6f 6e 20 53 54 20 3a | 2d 29 09 09 09 20 20 20 | on ST :|-)... |
|00001660| 20 2a 2f 0a 20 20 20 20 | 20 20 20 0a 20 20 20 20 | */. | . |
|00001670| 20 20 20 09 09 09 20 20 | 20 0a 20 20 20 20 20 20 | ... | . |
|00001680| 20 69 6e 74 20 20 28 2a | 20 63 67 70 29 28 29 3b | int (*| cgp)();|
|00001690| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 70 6f 69 6e | | /* poin|
|000016a0| 74 65 72 20 74 6f 20 63 | 61 6c 6c 67 75 6c 61 6d |ter to c|allgulam|
|000016b0| 28 29 20 20 20 20 2a 2f | 0a 20 20 20 20 20 20 20 |() */|. |
|000016c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000016d0| 20 20 20 20 20 20 20 20 | 2f 2a 20 61 6c 73 6f 20 | |/* also |
|000016e0| 63 6f 6e 74 61 69 6e 73 | 20 74 6f 67 75 5f 2c 20 |contains| togu_, |
|000016f0| 62 75 74 20 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |but */.| |
|00001700| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001710| 20 20 20 20 20 20 20 2f | 2a 20 61 20 74 79 70 65 | /|* a type|
|00001720| 20 69 73 20 64 69 66 66 | 65 72 65 6e 74 20 20 20 | is diff|erent |
|00001730| 20 20 20 20 2a 2f 0a 20 | 20 20 20 20 20 20 76 6f | */. | vo|
|00001740| 69 64 20 28 2a 20 67 6c | 70 29 28 29 3b 20 20 20 |id (* gl|p)(); |
|00001750| 20 20 20 20 20 20 2f 2a | 20 70 6f 69 6e 74 65 72 | /*| pointer|
|00001760| 20 74 6f 20 67 65 74 6c | 69 6e 65 76 69 61 75 65 | to getl|ineviaue|
|00001770| 28 29 20 2a 2f 0a 0a 20 | 20 20 20 20 20 20 66 70 |() */.. | fp|
|00001780| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 57 |rintf(st|derr, "W|
|00001790| 65 6c 63 6f 6d 65 20 74 | 6f 20 63 61 6c 6c 67 75 |elcome t|o callgu|
|000017a0| 6c 61 6d 20 64 65 6d 6f | 2e 5c 6e 22 29 3b 0a 20 |lam demo|.\n");. |
|000017b0| 20 20 20 20 20 20 73 61 | 76 65 5f 73 73 70 20 3d | sa|ve_ssp =|
|000017c0| 20 53 75 70 65 72 28 30 | 4c 29 3b 0a 20 20 20 20 | Super(0|L);. |
|000017d0| 20 20 20 74 67 70 74 72 | 20 3d 20 2a 53 48 45 4c | tgptr| = *SHEL|
|000017e0| 4c 50 3b 0a 20 20 20 20 | 20 20 20 53 75 70 65 72 |LP;. | Super|
|000017f0| 28 73 61 76 65 5f 73 73 | 70 29 3b 0a 0a 20 20 20 |(save_ss|p);.. |
|00001800| 20 20 20 20 69 66 20 28 | 47 5f 4d 41 47 49 43 20 | if (|G_MAGIC |
|00001810| 21 3d 20 28 73 68 5f 6d | 61 67 69 63 20 3d 20 2a |!= (sh_m|agic = *|
|00001820| 28 28 73 68 6f 72 74 20 | 2a 29 28 74 67 70 74 72 |((short |*)(tgptr|
|00001830| 20 2d 20 38 29 29 29 29 | 20 7b 0a 20 20 20 20 20 | - 8))))| {. |
|00001840| 20 20 20 20 20 20 20 20 | 20 20 66 70 72 69 6e 74 | | fprint|
|00001850| 66 20 28 73 74 64 65 72 | 72 2c 20 22 77 72 6f 6e |f (stder|r, "wron|
|00001860| 67 20 6d 61 67 69 63 20 | 76 61 6c 75 65 20 25 78 |g magic |value %x|
|00001870| 5c 6e 22 2c 20 73 68 5f | 6d 61 67 69 63 29 3b 0a |\n", sh_|magic);.|
|00001880| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 65 | | e|
|00001890| 78 69 74 20 28 31 29 3b | 0a 20 20 20 20 20 20 20 |xit (1);|. |
|000018a0| 7d 0a 0a 20 20 20 20 20 | 20 20 63 67 70 20 3d 20 |}.. | cgp = |
|000018b0| 2a 28 28 69 6e 74 20 28 | 2a 29 28 29 29 20 74 67 |*((int (|*)()) tg|
|000018c0| 70 74 72 29 3b 0a 20 20 | 20 20 20 20 20 67 6c 70 |ptr);. | glp|
|000018d0| 20 3d 20 2a 28 28 76 6f | 69 64 20 28 2a 29 28 29 | = *((vo|id (*)()|
|000018e0| 29 20 28 74 67 70 74 72 | 20 2d 20 36 29 29 3b 0a |) (tgptr| - 6));.|
|000018f0| 20 20 20 20 20 20 20 28 | 2a 20 63 67 70 29 28 22 | (|* cgp)("|
|00001900| 65 63 68 6f 20 27 74 65 | 73 74 20 6f 66 20 47 75 |echo 'te|st of Gu|
|00001910| 6c 61 6d 27 22 29 3b 0a | 20 20 20 20 20 20 20 28 |lam'");.| (|
|00001920| 2a 20 63 67 70 29 28 22 | 65 63 68 6f 20 27 65 78 |* cgp)("|echo 'ex|
|00001930| 65 63 75 74 69 6e 67 20 | 6c 73 20 2d 6c 27 22 29 |ecuting |ls -l'")|
|00001940| 3b 0a 20 20 20 20 20 20 | 20 28 2a 20 63 67 70 29 |;. | (* cgp)|
|00001950| 28 22 6c 73 20 2d 6c 22 | 29 3b 0a 20 20 20 20 20 |("ls -l"|);. |
|00001960| 20 20 28 2a 20 63 67 70 | 29 28 22 65 63 68 6f 20 | (* cgp|)("echo |
|00001970| 27 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |'-------|--------|
|00001980| 2d 2d 27 22 29 3b 0a 20 | 20 20 20 20 20 20 28 2a |--'");. | (*|
|00001990| 20 63 67 70 29 28 22 6c | 73 20 2d 52 20 2d 74 20 | cgp)("l|s -R -t |
|000019a0| 61 3a 5c 5c 20 22 29 3b | 0a 20 20 20 20 20 20 20 |a:\\ ");|. |
|000019b0| 28 2a 20 63 67 70 29 28 | 22 65 63 68 6f 20 27 20 |(* cgp)(|"echo ' |
|000019c0| 27 22 29 3b 0a 20 20 20 | 20 20 20 20 28 2a 20 63 |'");. | (* c|
|000019d0| 67 70 29 28 22 65 63 68 | 6f 20 27 20 27 22 29 3b |gp)("ech|o ' '");|
|000019e0| 0a 20 20 20 20 20 20 20 | 28 2a 20 63 67 70 29 28 |. |(* cgp)(|
|000019f0| 22 73 65 74 20 74 6d 70 | 5f 6f 6c 64 5f 70 72 6f |"set tmp|_old_pro|
|00001a00| 6d 70 74 20 24 70 72 6f | 6d 70 74 22 29 3b 0a 20 |mpt $pro|mpt");. |
|00001a10| 20 20 20 20 20 20 28 2a | 20 63 67 70 29 28 22 73 | (*| cgp)("s|
|00001a20| 65 74 20 70 72 6f 6d 70 | 74 20 27 41 74 20 79 6f |et promp|t 'At yo|
|00001a30| 75 72 20 73 65 72 76 69 | 63 65 2c 20 53 69 72 21 |ur servi|ce, Sir!|
|00001a40| 27 22 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |'");. | |
|00001a50| 20 20 20 20 2f 2a 20 63 | 68 61 6e 67 65 20 61 20 | /* c|hange a |
|00001a60| 67 65 6e 64 65 72 20 69 | 66 20 61 20 6e 65 65 64 |gender i|f a need|
|00001a70| 20 77 69 6c 6c 20 61 72 | 69 73 65 20 2a 2f 0a 20 | will ar|ise */. |
|00001a80| 20 20 20 20 20 20 28 2a | 20 63 67 70 29 28 22 65 | (*| cgp)("e|
|00001a90| 63 68 6f 20 27 41 77 61 | 69 74 69 6e 67 20 79 6f |cho 'Awa|iting yo|
|00001aa0| 75 72 20 63 6f 6d 6d 61 | 6e 64 73 21 21 27 22 29 |ur comma|nds!!'")|
|00001ab0| 3b 0a 20 20 20 20 20 20 | 20 2f 2a 20 74 68 65 20 |;. | /* the |
|00001ac0| 66 6f 6c 6c 6f 77 69 6e | 67 20 6c 6f 6f 70 20 77 |followin|g loop w|
|00001ad0| 69 6c 6c 20 63 79 63 6c | 65 20 75 6e 74 69 6c 20 |ill cycl|e until |
|00001ae0| 69 74 20 77 69 6c 6c 20 | 67 65 74 20 61 6e 20 65 |it will |get an e|
|00001af0| 6d 70 74 79 20 6c 69 6e | 65 20 2a 2f 0a 20 20 20 |mpty lin|e */. |
|00001b00| 20 20 20 20 77 68 69 6c | 65 20 28 28 2a 20 67 6c | whil|e ((* gl|
|00001b10| 70 29 28 62 75 66 29 2c | 20 70 75 74 63 68 61 72 |p)(buf),| putchar|
|00001b20| 28 27 5c 6e 27 29 2c 20 | 30 20 21 3d 20 73 74 72 |('\n'), |0 != str|
|00001b30| 6c 65 6e 28 62 75 66 29 | 29 20 7b 0a 20 20 20 20 |len(buf)|) {. |
|00001b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b60| 20 20 20 2f 2a 20 74 68 | 65 20 6e 65 77 20 6c 69 | /* th|e new li|
|00001b70| 6e 65 20 6e 6f 74 20 73 | 75 70 70 6c 69 65 64 20 |ne not s|upplied |
|00001b80| 2a 2f 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/. | |
|00001b90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ba0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 62 79 20 | | /* by |
|00001bb0| 47 75 6c 61 6d 20 2d 20 | 44 49 59 2c 20 6d 61 74 |Gulam - |DIY, mat|
|00001bc0| 65 20 20 20 20 20 20 20 | 2a 2f 0a 20 20 20 20 20 |e |*/. |
|00001bd0| 20 20 20 20 20 20 20 20 | 20 20 28 2a 20 63 67 70 | | (* cgp|
|00001be0| 29 28 62 75 66 29 3b 0a | 20 20 20 20 20 20 20 7d |)(buf);.| }|
|00001bf0| 0a 20 20 20 20 20 20 20 | 28 2a 20 63 67 70 29 28 |. |(* cgp)(|
|00001c00| 22 73 65 74 20 70 72 6f | 6d 70 74 20 24 74 6d 70 |"set pro|mpt $tmp|
|00001c10| 5f 6f 6c 64 5f 70 72 6f | 6d 70 74 22 29 3b 0a 20 |_old_pro|mpt");. |
|00001c20| 20 20 20 20 20 20 28 2a | 20 63 67 70 29 28 22 75 | (*| cgp)("u|
|00001c30| 6e 73 65 74 20 74 6d 70 | 5f 6f 6c 64 5f 70 72 6f |nset tmp|_old_pro|
|00001c40| 6d 70 74 22 29 3b 0a 20 | 20 20 20 20 20 20 66 70 |mpt");. | fp|
|00001c50| 72 69 6e 74 66 20 28 73 | 74 64 65 72 72 2c 22 5c |rintf (s|tderr,"\|
|00001c60| 6e 4e 69 63 65 20 74 61 | 6c 6b 69 6e 67 20 74 6f |nNice ta|lking to|
|00001c70| 20 79 6f 75 2c 20 73 65 | 65 20 79 6f 75 20 6c 61 | you, se|e you la|
|00001c80| 74 65 72 2e 5c 6e 22 29 | 3b 0a 20 20 20 20 20 20 |ter.\n")|;. |
|00001c90| 20 65 78 69 74 28 30 29 | 3b 0a 7d 0a 2f 2a 20 2d | exit(0)|;.}./* -|
|00001ca0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cb0| 2f 20 74 68 61 74 20 69 | 73 20 61 6c 6c 20 66 6f |/ that i|s all fo|
|00001cc0| 72 20 74 6f 64 61 79 20 | 2f 2d 2d 2d 2d 2d 2d 2d |r today |/-------|
|00001cd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 20 2a |--------|------ *|
|00001ce0| 2f 0a 0a 2d 2d 20 0a 09 | 4d 69 63 68 61 6c 20 4a |/..-- ..|Michal J|
|00001cf0| 61 65 67 65 72 6d 61 6e | 6e 0a 09 4d 79 72 69 61 |aegerman|n..Myria|
|00001d00| 73 20 52 65 73 65 61 72 | 63 68 20 43 6f 72 70 6f |s Resear|ch Corpo|
|00001d10| 72 61 74 69 6f 6e 0a 09 | 45 64 6d 6f 6e 74 6f 6e |ration..|Edmonton|
|00001d20| 2c 20 41 6c 62 65 72 74 | 61 2c 20 43 41 4e 41 44 |, Albert|a, CANAD|
|00001d30| 41 0a 09 2e 2e 2e 7b 69 | 68 6e 70 34 2c 20 75 62 |A.....{i|hnp4, ub|
|00001d40| 63 2d 76 69 73 69 6f 6e | 7d 21 65 6c 62 65 72 74 |c-vision|}!elbert|
|00001d50| 61 21 6d 79 72 69 61 73 | 21 6d 6a 0a 0a |a!myrias|!mj.. |
+--------+-------------------------+-------------------------+--------+--------+